<!doctype html>
<html>
<head>
<meta charset="utf-8">
<title>新增类别</title>
<!--公共样式开始-->
<link rel="stylesheet" type="text/css" href="{$NOW_THEME_URL}/Assets/Css/reset.css">
<link rel="stylesheet" type="text/css" href="{$NOW_THEME_URL}/Assets/Css/common.css">
<link rel="stylesheet" type="text/css" href="{$NOW_THEME_URL}/Assets/Plugins/FontAwesome/css/font-awesome.min.css">
<!--公共样式结束-->
<link rel="stylesheet" type="text/css" href="{$NOW_THEME_URL}/Assets/Css/module_form.css">
<link rel="stylesheet" type="text/css" href="{$NOW_THEME_URL}/Assets/Css/page_memberAdd.css">
<script src="{$NOW_THEME_URL}/Assets/Js/jquery.min.js"></script>
<script src="{$NOW_THEME_URL}/Assets/Js/jquery.timer.js"></script>
<script src="{$NOW_THEME_URL}/Assets/Js/common.js"></script>
</head>

<body>
<!-- 	<div class="table_tool">
		<ul class="clearfix">			
			<li class="btn"><i class="icon-plus"></i> 新建分组</li>
		</ul>
	</div> -->
	<div class="page_wraper" style="margin-top:20px;">
			<form action="" method="post" id="memberAdd_form">
				<table cellpadding="0" cellspacing="0" class="module_form">
					<tr>
						<td style="width:100px;"><label for="title">上级分类：<em>*</em></label></td>
						<td class="ele_content">
							<select id="pid">
								<option>请选择上级分类</option>
								<volist name="detail" id="vo">
									<option value="{$vo.id}">{$vo.title}</option>
								</volist>
							</select>
						</td>
					</tr>
					<tr>
						<td style="width:100px;"><label for="isleaf">有无子类：<em>*</em></label></td>
						<td class="ele_content">
							<select id="isleaf">
								<option value="1">有</option>
								<option value="2">无</option>
							</select>
						</td>
					</tr>
					<tr>
						<td style="width:100px;"><label for="title">类别名称：<em>*</em></label></td>
						<td class="ele_content">
							<input type="text" id="title" class="form_ele_text width_200">
						</td>
					</tr>
					<tr>
						<td style="width:100px;"><label for="keywords">关键字：</label></td>
						<td class="ele_content">
							<input type="text" id="keywords" class="form_ele_text width_200">
						</td>
					</tr>
					<tr>
						<td style="width:100px;"><label for="description">类别描述：</label></td>
						<td class="ele_content">
							<textarea rows="" cols="" id="description" ></textarea>
						</td>
					</tr>
				</table>
			</form>
	</div>
	<div class="page_footer pdtd10">
		<input type="button" name="submit" value="确认添加"  class="form_ele_submit"/>
		<input type="reset" name="reset" value="重置表单"  class="form_ele_reset"/>
	</div>
</body>
<script type="text/javascript">
	//弹出窗口全局变量
	var api = frameElement.api, W = api.opener;

	$(function(){
		//重置
		
		//提交
		$('.form_ele_submit').on('click',function(){
			//通过POST直接提交表单
			//$('#memberAdd_form').get(0).submit();
			//etcommon.maskShow();
			
			var tipsObj = windowApi.lhgdialog.tips('正在提交数据...',10,etIcon.loading);
			
			//通过Ajax提交表单
			var postData = {};
			
			postData.pid         = $('#pid').val();         //获取上级分类
			postData.isleaf      = $('#isleaf').val();      //是否有子类
			postData.title       = $('#title').val();       //获取类别名称
			postData.keywords    = $('#keywords').val();    //获取类别关键字
			postData.description = $('#description').val(); //获取类别描述
			alert(postData.isleaf);
			$.post("{:U('Column/add')}", postData ,
				function(data){
					tipsObj.close();
					windowApi.lhgdialog.tips('数据修改成功！',1,etIcon.success,function(){
						frameApi.close(); //关闭当前窗口
						var obj = windowApi.lhgdialog.list['Column_index'];
						obj.reload(obj);
					});
				}
			);
			
		});
	});
</script>
</html>
